/**
 * @author TatumCreative (Greg Tatum) / http://gregtatum.com/
 */



function updateGroupGeometry( mesh, geometry ) {

	mesh.children[ 0 ].geometry.dispose();
	mesh.children[ 1 ].geometry.dispose();

	mesh.children[ 0 ].geometry = new THREE.WireframeGeometry( geometry );
	mesh.children[ 1 ].geometry = geometry;

	// these do not update nicely together if shared
}


var guis = {

	ConeGeometry: function ( mesh ) {

		var data = {
			radius: 23,
			height: 32,
			radialSegments: 4,
			heightSegments: 1,
			openEnded: false,
			thetaStart: 0,
			thetaLength: Math.PI * 2
		};

		function generateGeometry() {

			updateGroupGeometry( mesh,
				new THREE.ConeGeometry(
					data.radius,
					data.height,
					data.radialSegments,
					data.heightSegments,
					data.openEnded,
					data.thetaStart,
					data.thetaLength
				)
			);

		}

		generateGeometry();

	}
};

function chooseFromHash( mesh ) {

	var selectedGeometry = window.location.hash.substring( 1 ) || "ConeGeometry";
	console.log(selectedGeometry);

	if ( guis[ selectedGeometry ] !== undefined ) {

		guis[ selectedGeometry ]( mesh );

	}

	//No configuration options
	return {};

}
